package com.mine.modules.vm.controller;

import com.mine.common.domain.vo.Result;
import com.mine.modules.vm.domain.query.PersonnelPageQuery;
import com.mine.modules.vm.service.IVmPersonnelDepartService;
import com.mine.modules.vm.service.IVmPersonnelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "人员管理")
@RestController
@RequestMapping("/vm/personnel")
@RequiredArgsConstructor
public class VmPersonnelController {

    private final IVmPersonnelDepartService vmPersonnelDepartService;

    private final IVmPersonnelService vmPersonnelService;

    @ApiOperation("部门树形列表")
    @RequestMapping(value = "/treeListDepart", method = RequestMethod.GET)
    public Result<?> treeListDepart() {
        return vmPersonnelDepartService.treeListDepart();
    }

    @ApiOperation("分页查询人员列表")
    @RequestMapping(value = "/pageListPersonnel", method = RequestMethod.GET)
    public Result<?> pageListPersonnel(PersonnelPageQuery pageQuery) {
        return vmPersonnelService.pageListPersonnel(pageQuery);
    }

}
